﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AJWPFAdmin.Services
{
    public interface IBaseNonTableCache<TEntity> where TEntity : class, new()
    {
        Task<List<TEntity>> GetOrSetListCache(Func<Task<List<TEntity>>> getListAsync, int cacheDurationInSeconds = 0, string cacheName = "");

        List<TEntity> GetOrSetListCacheWithInnerCacheTime(Func<(List<TEntity>, int)> getList, string cacheName = "");

        void SetListCache(List<TEntity> entity, int cacheDurationInSeconds = 0,string cacheName = "");

        void RemoveListCache(string cacheName = "");

        string GetStringCache(string cacheName = "");

        void SetStringCache(string targetVal, string cacheName = "", int cacheDurationInSeconds = 0);

        Task<string> GetOrSetStringCache(Func<Task<string>> getTargetValAsync, string cacheName = "", int cacheDurationInSeconds = 0);

    }
}
